<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <body>

        <ui:composition template="./../../Template/generalTemplate.xhtml">

            <ui:define name="content">

                <h:form id="form">
                    <f:view beforePhase="#{generateOrdersResultManagedBean.initView}"> 
                        <p:panel id="OrderTable" header="Orders Detail" style="height:495px;">

                            <div style="margin-left: 20px;margin-right: 20px;">
                                <p:wizard showStepStatus="false"  widgetVar="wiz" style="height:450px;" flowListener="#{generateOrdersResultManagedBean.onFlowProcess}">
                                    <p:tab title="1" id="pickingOrder">
                                          <h:panelGrid id="picking"  >
                                 
                                            <h:outputText style="font-size: 20px;"  value="Picking Order" />
                                       
                                        <h:panelGrid id="grid1" style="width:300px;" columns="2">
                                            <h:outputText value="Picking Order Id:  "/>
                                            <h:outputText value="#{generateOrdersResultManagedBean.selectedDeliveryOrder.pickingOrder.id}"/>

                                            <h:outputText value="Source Delivery Order Id:  "/>
                                            <h:outputText value="#{generateOrdersResultManagedBean.selectedDeliveryOrder.id}"/>
                                            
                                            <h:outputText value="Company Name:  "/>
                                            <h:outputText value="#{generateOrdersResultManagedBean.selectedDeliveryOrder.parentSalesOrder.customer.name}"/>

                                            <h:outputText value="Generate Date:  "/>
                                            <h:outputText value="#{generateOrdersResultManagedBean.selectedDeliveryOrder.generateDate}">
                                                <f:convertDateTime pattern="dd/MM/yyyy"/>
                                            </h:outputText>


                                            <h:outputText value="Delivery Date:  "/>
                                            <h:outputText value="#{generateOrdersResultManagedBean.selectedDeliveryOrder.deliveryDate}">
                                                <f:convertDateTime pattern="dd/MM/yyyy"/>
                                            </h:outputText>
                                        </h:panelGrid>
                                        <p:dataTable id="pickingOrderLineItem" dynamic="true" emptyMessage="No Item to display" value="#{generateOrdersResultManagedBean.selectedDeliveryOrder.deliveryOrderLineItems}" var ="lineItems">
                                            <p:column>
                                                <f:facet name="header">Product Name</f:facet>
                                                #{lineItems.product.productName}
                                            </p:column>

                                            <p:column>
                                                <f:facet name="header">Required Quantity</f:facet>
                                                #{lineItems.quantity}
                                            </p:column>

                                            <p:column>
                                                <f:facet name="header">Pick Up Location</f:facet>
                                                #{lineItems.product.warehouseLocation}
                                            </p:column>
                                        </p:dataTable>
                                        <br />
                                        </h:panelGrid>
                                        <h:outputLink  style="position:absolute;top:150px;right:50px;" id="lnk" value="Print">  
                                            <p:printer target="picking" />  
                                            <p:graphicImage value="/images/document-print.png" style="height:25px; width:25px;" />  
                                        </h:outputLink>   

                                    </p:tab>

                                    <p:tab title="2" id="packingOrder">
                                        <h:panelGrid id="packing"  >
                                       
                                            <h:outputText style="font-size: 20px;"  value="Packing Order" />
                                        
                                        <h:panelGrid id="grid2" style="width:300px;" columns="2">
                                            <h:outputText value="Packing Order Id:  "/>
                                            <h:outputText value="#{generateOrdersResultManagedBean.selectedDeliveryOrder.packingOrder.id}"/>

                                            <h:outputText value="Source Delivery Order Id:  "/>
                                            <h:outputText value="#{generateOrdersResultManagedBean.selectedDeliveryOrder.id}"/>
                                            <h:outputText value="Company Name:  "/>
                                            <h:outputText value="#{generateOrdersResultManagedBean.selectedDeliveryOrder.parentSalesOrder.customer.name}"/>

                                            <h:outputText value="Generate Date:  "/>
                                            <h:outputText value="#{generateOrdersResultManagedBean.selectedDeliveryOrder.generateDate}">
                                                <f:convertDateTime pattern="dd/MM/yyyy"/>
                                            </h:outputText>
                                            <h:outputText value="Delivery Date:  "/>
                                            <h:outputText value="#{generateOrdersResultManagedBean.selectedDeliveryOrder.deliveryDate}">
                                                <f:convertDateTime pattern="dd/MM/yyyy"/>
                                            </h:outputText>

                                        </h:panelGrid>
                                        <p:dataTable id="packingOrderLineItem" dynamic="true" emptyMessage="No Item to display" value="#{generateOrdersResultManagedBean.selectedDeliveryOrder.deliveryOrderLineItems}" var ="lineItems">
                                            <p:column>
                                                <f:facet name="header">Product Name</f:facet>
                                                #{lineItems.product.productName}
                                            </p:column>

                                            <p:column>
                                                <f:facet name="header">Required Quantity</f:facet>
                                                #{lineItems.quantity}
                                            </p:column>


                                        </p:dataTable>
                                        </h:panelGrid>
                                        <br />
                                        <h:outputLink style="position:absolute;top:150px;right:50px;" id="lnk2" value="Print">  
                                            <p:printer target="packing" />  
                                            <p:graphicImage value="/images/document-print.png" style="height:25px; width:25px;" />  
                                        </h:outputLink>   

                                    </p:tab>
                                    <p:tab title="3" id="shippingOrder">
                                        <h:panelGrid id="shipping"  >
                                       
                                            <h:outputText style="font-size: 20px;" value="Shipping Order" />
                                      
                                        <h:panelGrid id="grid3" style="width:300px;" columns="2">
                                            <h:outputText value="Shipping Order Id"/>
                                            <h:outputText value="#{generateOrdersResultManagedBean.selectedDeliveryOrder.id}"/>

                                            <h:outputText value="Source Delivery Order Id"/>
                                            <h:outputText value="#{generateOrdersResultManagedBean.selectedDeliveryOrder.id}"/>
                                              <h:outputText value="Company Name:  "/>
                                            <h:outputText value="#{generateOrdersResultManagedBean.selectedDeliveryOrder.parentSalesOrder.customer.name}"/>

                                            <h:outputText value="Generate Date"/>
                                            <h:outputText value="#{generateOrdersResultManagedBean.selectedDeliveryOrder.generateDate}">
                                                <f:convertDateTime pattern="dd/MM/yyyy"/>
                                            </h:outputText>


                                            <h:outputText value="Delivery Date"/>
                                            <h:outputText value="#{generateOrdersResultManagedBean.selectedDeliveryOrder.deliveryDate}">
                                                <f:convertDateTime pattern="dd/MM/yyyy"/>
                                            </h:outputText>


                                            <h:outputText value="Street Name"/>
                                            <h:outputText value="#{generateOrdersResultManagedBean.selectedDeliveryOrder.shippingAddress.streetName}"/>
                                            <h:outputText value="City"/>
                                            <h:outputText value="#{generateOrdersResultManagedBean.selectedDeliveryOrder.shippingAddress.city}"/>
                                            <h:outputText value="Post Code"/>
                                            <h:outputText value="#{generateOrdersResultManagedBean.selectedDeliveryOrder.shippingAddress.postCode}"/>
                                        </h:panelGrid>
                                        <p:dataTable id="shippingOrderLineItem" dynamic="true" emptyMessage="No Item to display" value="#{generateOrdersResultManagedBean.selectedDeliveryOrder.deliveryOrderLineItems}" var ="lineItems">
                                            <p:column>
                                                <f:facet name="header">Product Name</f:facet>
                                                #{lineItems.product.productName}
                                            </p:column>

                                            <p:column>
                                                <f:facet name="header">Required Quantity</f:facet>
                                                #{lineItems.quantity}
                                            </p:column>
                                        

                                        </p:dataTable>
                                            </h:panelGrid>
                                        <p:commandButton value="Go Back" style="position:absolute;right:50px;bottom:100px;" actionListener="#{generateOrdersResultManagedBean.goBack}"/>
                                        <h:outputLink style="position:absolute;top:150px;right:50px;" id="lnk3" value="Print">  
                                            <p:printer target="shipping" />  
                                            <p:graphicImage value="/images/document-print.png" style="height:25px; width:25px;" />  
                                        </h:outputLink>   

                                    </p:tab>

                                </p:wizard>
                            </div> 
                        </p:panel>
                    </f:view>
                </h:form>

            </ui:define>


        </ui:composition>

    </body>
</html>

